

public class PrinterI extends Demo._PrinterDisp {
	RandomMultiBodySystem system;
	int[] rangeMass = new int[2];
	int[] rangeRadii = new int[2];
	int numberOfBodies;
	double massCentralBody;
	int[] spaceCircumference = new int[2];
	int delta_t;

	public void setNumberOfBodies(int numOfBodies, Ice.Current current) {
		this.numberOfBodies = numOfBodies;
	}

	public void setLowerLimitMass(int lowLMass, Ice.Current current) {
		this.rangeMass[0] = lowLMass;
	}

	public void setUpperLimitMass(int uppLMass, Ice.Current current) {
		this.rangeMass[1] = uppLMass;

	}

	public void setLowerLimitRadii(int lowLRadii, Ice.Current current) {
		this.rangeRadii[0] = lowLRadii;

	}

	public void setUpperLimitRadii(int uppLRadii, Ice.Current current) {
		this.rangeRadii[1] = uppLRadii;
	}

	public void setMassCentralBody(double massCBody, Ice.Current current) {
		this.massCentralBody = massCBody;
	}

	public void setSpaceCircumferenceLowerLimit(int spaceCirLowL, Ice.Current current){
    	this.spaceCircumference[0] = spaceCirLowL;
    }
	public void setSpaceCircumferenceUpperLimit(int spaceCirUppL, Ice.Current current){
		this.spaceCircumference[1] = spaceCirUppL;
	}
	public void setDeltaT(int delta_t, Ice.Current current){
		this.delta_t = delta_t;
	}
	public void initRandomMultiBodySystem(Ice.Current current){
		this.system = new RandomMultiBodySystem(rangeMass, rangeRadii, numberOfBodies, massCentralBody, spaceCircumference, delta_t);
	}
	

	public Demo.BodyStruct[] getBodyStructList(Ice.Current current){
		int bodyListLength = system.getBodyList().size();
		Body currentBody;
		Demo.BodyStruct[] bodyStructList = new Demo.BodyStruct[bodyListLength];
		for (int i=0; i<bodyListLength; i++){
			bodyStructList[i] = new Demo.BodyStruct();
			currentBody = system.getBodyList().get(i);
			bodyStructList[i].id = currentBody.getId();
			bodyStructList[i].radius = currentBody.getRadius();
			bodyStructList[i].posX = currentBody.getPosition().x;
			bodyStructList[i].posY = currentBody.getPosition().y;
			bodyStructList[i].posZ = currentBody.getPosition().z;
		}
		return bodyStructList;
	}
	public int calcOneStep(Ice.Current current){
		system.calcOneStep();
		return 1;
	}
}
